<!doctype html>
<html>
<head>
<meta charset="utf-8">
    <title>淘宝机票</title>
    <style>
        .add1, .add2, .ticket_date { border: 1px solid #7F9DB9; height: 14px; line-height: 14px; margin: 0 3px; padding: 1px 1px 1px 3px; width: 71px; }
        span { color: #07519A; margin-right: 4px; }
        body, input, form, div { font-size: 12px; margin: 0; padding: 0; }
        body { background-color: none; }
        .ticket { margin-top: 6px; }
    </style>
</head>
<body>
    <form id="tab_1" name="tab_1" action="" target="_blank" method="get">
    <div class="ticket">
        <span>从</span>
        <input class="add1" name="t" type="text" value="北京" />
        <span style="margin: 0 4px;">到</span>
        <input class="add2" name="q" type="text" value="上海" />
    </div>
    <div class="ticket">
        <span>日期</span>
        <input class="ticket_date" id="date" name="date" type="text" value="" />
        <input class="ticket_btm" type="submit" value="查看折扣价" />
    </div>
    </form>
    <script type="text/javascript">
        Date.prototype.format = function (format) {
            var o = {
                "M+": this.getMonth() + 1, //month 
                "d+": this.getDate(),    //day 
                "h+": this.getHours(),   //hour 
                "m+": this.getMinutes(), //minute 
                "s+": this.getSeconds(), //second 
                "q+": Math.floor((this.getMonth() + 3) / 3),  //quarter 
                "S": this.getMilliseconds() //millisecond 
            }
            if (/(y+)/.test(format)) format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            for (var k in o)
                if (new RegExp("(" + k + ")").test(format))
                    format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
            return format;
        }
        var nowDate = new Date();
        nowDate.setDate(nowDate.getDate() + 1);
        document.getElementById('date').value = nowDate.format("yyyy-MM-dd");
    </script>
</body>
</html>
